package cn.itcast.recordservice.Impl;

import cn.itcast.domain.HeiMaClass;
import cn.itcast.domain.Record;
import cn.itcast.recorddao.HeiMaClassRepository;
import cn.itcast.recorddao.RecordRepository;
import cn.itcast.recordservice.RecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class RecordServiceImpl implements RecordService {
    //注入dao
    @Autowired
  private RecordRepository recordRepository;
    @Autowired
    private HeiMaClassRepository heiMaClassRepository;

    @Override
    public void save(Record record) {
        recordRepository.save(record);
    }

    @Override
    public List<Record> findByMonth(String month) {
      return   recordRepository.findByMonth(month);
    }

    @Override
    public Record findByDay(String day) {
        return recordRepository.findByDay(day);
    }

    @Override
    public HeiMaClass findByCid(String cid) {

        return heiMaClassRepository.finByCid(cid);
    }



}
